<html>
<head>
  <title>23-InnoDB隔离级别与锁粒度</title>
  <basefont face="微软雅黑" size="2" />
  <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
  <meta name="exporter-version" content="YXBJ Windows/600646 (zh-CN, DDL); Windows/6.1.1 (Win64);"/>
  <meta name="content-class" content="yinxiang.markdown"/>
  <style>
    body, td {
      font-family: 微软雅黑;
      font-size: 10pt;
    }
  </style>
</head>
<body>
<a name="1199"/>
<h1>23-InnoDB隔离级别与锁粒度</h1>

<div><span><div style="font-size: 14px; margin: 0; padding: 0; width: 100%;"><p style="line-height: 160%; box-sizing: content-box; margin: 10px 0; color: #333;">参考：https://www.cnblogs.com/crazylqy/p/7611069.html</p>
<h2 style="line-height: 160%; box-sizing: content-box; font-weight: 700; font-size: 34px; border-bottom: 1px solid #dbdbdb; color: #333;">1 2PL：Two-Phase Locking</h2>
<p style="line-height: 160%; box-sizing: content-box; margin: 10px 0; color: #333;">传统RDBMS加锁的一个原则，就是2PL (二阶段锁)：Two-Phase Locking。相对而言，2PL比较容易理解，说的是锁操作分为两个阶段：加锁阶段与解锁阶段，并且保证加锁阶段与解锁阶段不相交。下面，仍旧以MySQL为例，来简单看看2PL在MySQL中的实现。<br/>
<img src="23-InnoDB隔离级别与锁粒度_files/Image.png" type="image/png" data-filename="Image.png"/></p>
<h2 style="line-height: 160%; box-sizing: content-box; font-weight: 700; font-size: 34px; border-bottom: 1px solid #dbdbdb; color: #333;">2 MySQL InnoDB存储引擎中事务隔离级别与锁粒度</h2>
<h3 style="line-height: 160%; box-sizing: content-box; font-weight: 700; font-size: 27px; color: #333;">2-1 当前读与快照读</h3>
<p style="line-height: 160%; box-sizing: content-box; margin: 10px 0; color: #333;"><strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">RDBMS即关系数据库管理系统(Relational Database Management System)，是将数据组织为相关的行和列的系统。</strong></p>
<p style="line-height: 160%; box-sizing: content-box; margin: 10px 0; color: #333;">MySQL InnoDB存储引擎，实现的是<strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">基于多版本并发控制协议MVCC，Multi-Version Concurrency Control</strong>。<br/>
与MVCC相对的，是<strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">基于锁的并发控制，Lock-Based Concurrency Control</strong>。</p>
<p style="line-height: 160%; box-sizing: content-box; margin: 10px 0; color: #333;">MVCC最大的好处就是<strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">读不加锁，读写不冲突</strong>（Serializable隔离级别除外）。在MVCC并发控制中，读操作可以分为两类：</p>
<ul style="line-height: 160%; box-sizing: content-box; display: block; list-style-type: disc; padding-left: 30px; margin: 6px 0 10px; color: #333;">
<li style="line-height: 160%; box-sizing: content-box; position: relative;">
<p style="line-height: 160%; box-sizing: content-box; color: #333; margin: 0;"><strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">快照读（snapshop read）</strong>：读取的是记录的可见版本（有可能是历史版本），不用加锁（当然，也有例外）；</p>
</li>
<li style="line-height: 160%; box-sizing: content-box; position: relative;">
<p style="line-height: 160%; box-sizing: content-box; color: #333; margin: 0;"><strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">当前读（current read）</strong>：读取的是记录的最新版本，并且，当前读返回的记录，都会加上锁，保证其他事务不会再并发修改这条记录。</p>
</li>
</ul>
<p style="line-height: 160%; box-sizing: content-box; margin: 10px 0; color: #333;">在一个支持MVCC并发控制的系统中，哪些读操作是快照读？哪些操作又是当前读呢？以MySQL InnoDB为例：</p>
<ul style="line-height: 160%; box-sizing: content-box; display: block; list-style-type: disc; padding-left: 30px; margin: 6px 0 10px; color: #333;">
<li style="line-height: 160%; box-sizing: content-box; position: relative;">
<p style="line-height: 160%; box-sizing: content-box; color: #333; margin: 0;"><strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">快照读</strong>：简单的select操作，属于快照度，不加锁（当然，有例外）；<br/>
例如：<br/>
select * from table where ？；</p>
</li>
<li style="line-height: 160%; box-sizing: content-box; position: relative;">
<p style="line-height: 160%; box-sizing: content-box; color: #333; margin: 0;"><strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">当前读</strong>：特殊的读操作，插入/更新/删除操作，属于当前读，需要加锁；<br/>
例如：<br/>
select * from table where ? lock in share mode；<br/>
select * from table where ? for update；<br/>
insert into table values（...）；<br/>
update table set ? where ?；<br/>
delete from table where ? ；<br/>
所有以上的语句，都属于<strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">当前读</strong>，读取记录的最新版本。并且，读取之后，还需要保证其他并发事务不能修改当前记录，对读取记录加锁。其中，除了<strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">第一条语句，对读取记录加S锁 （共享锁）外，其他的操作，都加的是X锁 （排它锁）</strong>。</p>
</li>
</ul>
<p style="line-height: 160%; box-sizing: content-box; margin: 10px 0; color: #333;">为什么将 插入/更新/删除 操作，都归为当前读？可以看看下面这个 更新 操作，在数据库中的执行流程：<img src="23-InnoDB隔离级别与锁粒度_files/Image [1].png" type="image/png" data-filename="Image.png"/></p>
<p style="line-height: 160%; box-sizing: content-box; margin: 10px 0; color: #333;">从图中，可以看到，一个Update操作的具体流程。当Update SQL被发给MySQL后，MySQL Server会根据where条件，读取第一条满足条件的记录，然后InnoDB引擎会将第一条记录返回，并加锁 (current read)。待MySQL Server收到这条加锁的记录之后，会再发起一个Update请求，更新这条记录。一条记录操作完成，再读取下一条记录，直至没有满足条件的记录为止。因此，Update操作内部，就包含了一个当前读。同理，Delete操作也一样。Insert操作会稍微有些不同，简单来说，就是Insert操作可能会触发Unique Key的冲突检查，也会进行一个当前读。</p>
<p style="line-height: 160%; box-sizing: content-box; margin: 10px 0; color: #333;">注：根据上图的交互，针对一条当前读的SQL语句，InnoDB与MySQL Server的交互，是一条一条进行的，因此，加锁也是一条一条进行的。先对一条满足条件的记录加锁，返回给MySQL Server，做一些DML操作；然后在读取下一条加锁，直至读取完毕。</p>
<h3 style="line-height: 160%; box-sizing: content-box; font-weight: 700; font-size: 27px; color: #333;">2-2 事务隔离级别与锁粒度</h3>
<h4 style="line-height: 160%; box-sizing: content-box; font-size: 20px; color: #333;">Read Uncommitted</h4>
<p style="line-height: 160%; box-sizing: content-box; margin: 10px 0; color: #333;">可以读取未提交记录，此隔离级别，不会使用，可以忽略。</p>
<h4 style="line-height: 160%; box-sizing: content-box; font-size: 20px; color: #333;">Read Committed</h4>
<ul style="line-height: 160%; box-sizing: content-box; display: block; list-style-type: disc; padding-left: 30px; margin: 6px 0 10px; color: #333;">
<li style="line-height: 160%; box-sizing: content-box; position: relative;">快照读：MVCC（版本链 + ReadView）</li>
<li style="line-height: 160%; box-sizing: content-box; position: relative;">当前读：RC隔离级别保证对读到的记录加锁（记录锁），存在幻读现象</li>
</ul>
<h4 style="line-height: 160%; box-sizing: content-box; font-size: 20px; color: #333;">Repeatable Read</h4>
<ul style="line-height: 160%; box-sizing: content-box; display: block; list-style-type: disc; padding-left: 30px; margin: 6px 0 10px; color: #333;">
<li style="line-height: 160%; box-sizing: content-box; position: relative;">快照读：MVCC（版本链 + ReadView）</li>
<li style="line-height: 160%; box-sizing: content-box; position: relative;">当前读：RR隔离级别保证对读到的记录加锁（记录锁），同时保证对读取的范围加锁，新的满足查询条件的记录不能够插入（间隙锁），不存在幻读现象。</li>
</ul>
<h4 style="line-height: 160%; box-sizing: content-box; font-size: 20px; color: #333;">Serializable</h4>
<p style="line-height: 160%; box-sizing: content-box; margin: 10px 0; color: #333;">从MVCC并发控制退化为基于锁的并发控制。不区别快照读和当前读，所有的读操作均为当前读，读加共享锁（S锁），写加排他锁（X锁）。</p>
<p style="line-height: 160%; box-sizing: content-box; margin: 10px 0; color: #333;">Serializable隔离级别下，读写冲突，因此并发性能很差，在MySQL的InnoDB下不建议使用。</p>
<p style="line-height: 160%; box-sizing: content-box; margin: 10px 0; color: #333;"><strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">在MYSQL的事务引擎中，INNODB是使用范围最广的。它默认的事务隔离级别是REPEATABLE READ(可重复读），在标准的事务隔离级别定义下，REPEATABLE READ是不能防止幻读产生的。INNODB使用了next-key locks实现了防止幻读的发生。</strong></p>
<h2 style="line-height: 160%; box-sizing: content-box; font-weight: 700; font-size: 34px; border-bottom: 1px solid #dbdbdb; color: #333;">3 加锁过程分析</h2>
<h3 style="line-height: 160%; box-sizing: content-box; font-weight: 700; font-size: 27px; color: #333;">3-1 前提分析</h3>
<p style="line-height: 160%; box-sizing: content-box; margin: 10px 0; color: #333;">分析一条SQL的加锁过程，首先需要明确前提的条件：</p>
<ul style="line-height: 160%; box-sizing: content-box; display: block; list-style-type: disc; padding-left: 30px; margin: 6px 0 10px; color: #333;">
<li style="line-height: 160%; box-sizing: content-box; position: relative;">数据库当前的隔离级别</li>
<li style="line-height: 160%; box-sizing: content-box; position: relative;">相关条件列的索引情况：主键、唯一索引、普通二级索引、没有索引</li>
</ul>
<p style="line-height: 160%; box-sizing: content-box; margin: 10px 0; color: #333;"><strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">在RC、RR隔离级别下，快照读（普通select）操作均不加锁，而是使用MVCC提供的版本链和ReadView的方式。</strong></p>
<p style="line-height: 160%; box-sizing: content-box; margin: 10px 0; color: #333;">下面主要分析<strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">当前读</strong>操作的加锁情况、当前读包含的几种形式上面已经说过。</p>
<h3 style="line-height: 160%; box-sizing: content-box; font-weight: 700; font-size: 27px; color: #333;">3-2 简单语句分析</h3>
<p style="line-height: 160%; box-sizing: content-box; margin: 10px 0; color: #333;">以<strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">update test set name = 'Tom' where id = 10</strong>语句为例：</p>
<h4 style="line-height: 160%; box-sizing: content-box; font-size: 20px; color: #333;">Read Committed隔离级别</h4>
<p style="line-height: 160%; box-sizing: content-box; margin: 10px 0; color: #333;">在该隔离级别下，InnoDB只提供<strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">Record Locks</strong>。</p>
<ul style="line-height: 160%; box-sizing: content-box; display: block; list-style-type: disc; padding-left: 30px; margin: 6px 0 10px; color: #333;">
<li style="line-height: 160%; box-sizing: content-box; position: relative;">id为主键时，只在id = 10这条记录上加X锁；</li>
<li style="line-height: 160%; box-sizing: content-box; position: relative;">id为唯一索引，那么需要加2个X锁，一个对应于id unique索引上的id = 10 的记录，另一把锁对应聚簇索引上的id=10对应的记录；（为什么要在聚簇索引记录上加锁呢，因为如果并发一个SQL，通过主键索引更新这条记录，那么就违背了同一记录上的更新/删除需要串行执行的约束）；</li>
<li style="line-height: 160%; box-sizing: content-box; position: relative;">id为普通二级索引时，那么检索条件对应的二级索引记录和聚簇索引上的记录都会加锁；</li>
<li style="line-height: 160%; box-sizing: content-box; position: relative;">id列没有索引时，会走聚簇索引的全扫描进行过滤，由于过滤是由MySQL Server层面进行的。因此每条记录，无论是否满足条件，都会被加上X锁。但是，为了效率考量，MySQL做了优化，对于不满足条件的记录，会在判断后放锁，最终持有的，是满足条件的记录上的锁，但是不满足条件的记录上的加锁/放锁动作不会省略。同时，优化也违背了2PL的约束。</li>
</ul>
<h4 style="line-height: 160%; box-sizing: content-box; font-size: 20px; color: #333;">Reapeatable Read隔离级别</h4>
<p style="line-height: 160%; box-sizing: content-box; margin: 10px 0; color: #333;">在该隔离级别下，InnoDB提供<strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">Next-Key Locks，即Record Locks + Gap Locks</strong>。</p>
<ul style="line-height: 160%; box-sizing: content-box; display: block; list-style-type: disc; padding-left: 30px; margin: 6px 0 10px; color: #333;">
<li style="line-height: 160%; box-sizing: content-box; position: relative;">id为主键时，与RC隔离级别下一致；</li>
<li style="line-height: 160%; box-sizing: content-box; position: relative;">id为唯一索引时，与RC隔离级别下一致；</li>
</ul>
<p style="line-height: 160%; box-sizing: content-box; margin: 10px 0; color: #333;">MySQL的InnoDB引擎下RR是可以防止幻读情况发生的，那么对于id为主键或者唯一索引时，是不会发生幻读的情况的，因为这两种情况只会定位到唯一一条记录。</p>
<ul style="line-height: 160%; box-sizing: content-box; display: block; list-style-type: disc; padding-left: 30px; margin: 6px 0 10px; color: #333;">
<li style="line-height: 160%; box-sizing: content-box; position: relative;">
<p style="line-height: 160%; box-sizing: content-box; color: #333; margin: 0;">id为普通二级索引时，会首先通过id索引定位到第一条满足查询条件的记录，通过id索引定位到第一条满足查询条件的记录，加记录上的X锁，加GAP上的GAP锁，然后加主键聚簇索引上的记录X锁，然后返回；然后读取下一条，重复进行。直至进行到第一条不满足条件的记录[11,f]，此时，不需要加记录X锁，但是仍旧需要加GAP锁，最后返回结束。<br/>
<img src="23-InnoDB隔离级别与锁粒度_files/Image [2].png" type="image/png" data-filename="Image.png"/></p>
</li>
<li style="line-height: 160%; box-sizing: content-box; position: relative;">
<p style="line-height: 160%; box-sizing: content-box; color: #333; margin: 0;">id无索引，在Repeatable Read隔离级别下，如果进行全表扫描的当前读，那么会锁上表中的所有记录，同时会锁上聚簇索引内的所有GAP，杜绝所有的并发 更新/删除/插入 操作。</p>
</li>
</ul>
<h3 style="line-height: 160%; box-sizing: content-box; font-weight: 700; font-size: 27px; color: #333;">3-3 复杂语句分析</h3>
<p style="line-height: 160%; box-sizing: content-box; margin: 10px 0; color: #333;"><img src="23-InnoDB隔离级别与锁粒度_files/Image [3].png" type="image/png" data-filename="Image.png"/></p>
<p style="line-height: 160%; box-sizing: content-box; margin: 10px 0; color: #333;">如图中的SQL，会加什么锁？假定在Repeatable Read隔离级别下 (Read Committed隔离级别下的加锁情况，留给读者分析。)，同时，假设SQL走的是idx_t1_pu索引。<br/>
<img src="23-InnoDB隔离级别与锁粒度_files/Image [4].png" type="image/png" data-filename="Image.png"/></p>
<p style="line-height: 160%; box-sizing: content-box; margin: 10px 0; color: #333;">在分析出SQL where条件的构成之后，再来看看这条SQL的加锁情况 (RR隔离级别)，如下图所示：<br/>
<img src="23-InnoDB隔离级别与锁粒度_files/Image [5].png" type="image/png" data-filename="Image.png"/></p>
<p style="line-height: 160%; box-sizing: content-box; margin: 10px 0; color: #333;">从图中可以看出，在Repeatable Read隔离级别下，由Index Key所确定的范围，被加上了GAP锁；Index Filter锁给定的条件 (userid = ‘hdc’)何时过滤，视MySQL的版本而定，在MySQL 5.6版本之前，不支持Index Condition Pushdown(ICP)，因此Index Filter在MySQL Server层过滤，在5.6后支持了Index Condition Pushdown，则在index上过滤。若不支持ICP，不满足Index Filter的记录，也需要加上记录X锁，若支持ICP，则不满足Index Filter的记录，无需加记录X锁 (图中，用红色箭头标出的X锁，是否要加，视是否支持ICP而定)；而Table Filter对应的过滤条件，则在聚簇索引中读取后，在MySQL Server层面过滤，因此聚簇索引上也需要X锁。最后，选取出了一条满足条件的记录[8,hdc,d,5,good]，但是加锁的数量，要远远大于满足条件的记录数量。</p>
<p style="line-height: 160%; box-sizing: content-box; margin: 10px 0; color: #333;"><strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">结论：在Repeatable Read隔离级别下，针对一个复杂的SQL，首先需要提取其where条件。Index Key确定的范围，需要加上GAP锁；Index Filter过滤条件，视MySQL版本是否支持ICP，若支持ICP，则不满足Index Filter的记录，不加X锁，否则需要X锁；Table Filter过滤条件，无论是否满足，都需要加X锁。</strong></p>
<h2 style="line-height: 160%; box-sizing: content-box; font-weight: 700; font-size: 34px; border-bottom: 1px solid #dbdbdb; color: #333;">4 死锁原理与分析</h2>
<p style="line-height: 160%; box-sizing: content-box; margin: 10px 0; color: #333;">本文前面的部分，基本上已经涵盖了MySQL/InnoDB所有的加锁规则。深入理解MySQL如何加锁，有两个比较重要的作用：</p>
<ul style="line-height: 160%; box-sizing: content-box; display: block; list-style-type: disc; padding-left: 30px; margin: 6px 0 10px; color: #333;">
<li style="line-height: 160%; box-sizing: content-box; position: relative;">可以根据MySQL的加锁规则，写出不会发生死锁的SQL；</li>
<li style="line-height: 160%; box-sizing: content-box; position: relative;">可以根据MySQL的加锁规则，定位出线上产生死锁的原因；</li>
</ul>
<p style="line-height: 160%; box-sizing: content-box; margin: 10px 0; color: #333;">下面，来看看两个死锁的例子 (一个是两个Session的两条SQL产生死锁；另一个是两个Session的一条SQL，产生死锁)：<img src="23-InnoDB隔离级别与锁粒度_files/Image [6].png" type="image/png" data-filename="Image.png"/><br/>
<img src="23-InnoDB隔离级别与锁粒度_files/Image [7].png" type="image/png" data-filename="Image.png"/></p>
<p style="line-height: 160%; box-sizing: content-box; margin: 10px 0; color: #333;">上面的两个死锁用例。第一个非常好理解，也是最常见的死锁，每个事务执行两条SQL，分别持有了一把锁，然后加另一把锁，产生死锁。</p>
<p style="line-height: 160%; box-sizing: content-box; margin: 10px 0; color: #333;">第二个用例，虽然每个Session都只有一条语句，仍旧会产生死锁。要分析这个死锁，首先必须用到本文前面提到的MySQL加锁的规则。针对Session 1，从name索引出发，读到的[hdc, 1]，[hdc, 6]均满足条件，不仅会加name索引上的记录X锁，而且会加聚簇索引上的记录X锁，加锁顺序为先[1,hdc,100]，后[6,hdc,10]。而Session 2，从pubtime索引出发，[10,6],[100,1]均满足过滤条件，同样也会加聚簇索引上的记录X锁，加锁顺序为[6,hdc,10]，后[1,hdc,100]。发现没有，跟Session 1的加锁顺序正好相反，如果两个Session恰好都持有了第一把锁，请求加第二把锁，死锁就发生了。</p>
<p style="line-height: 160%; box-sizing: content-box; margin: 10px 0; color: #333;"><strong style="line-height: 160%; box-sizing: content-box; font-weight: 700;">结论：死锁的发生与否，并不在于事务中有多少条SQL语句，死锁的关键在于：两个(或以上)的Session加锁的顺序不一致。而使用本文上面提到的，分析MySQL每条SQL语句的加锁规则，分析出每条语句的加锁顺序，然后检查多个并发SQL间是否存在以相反的顺序加锁的情况，就可以分析出各种潜在的死锁情况，也可以分析出线上死锁发生的原因。</strong></p>
</div><center style="display:none !important;visibility:collapse !important;height:0 !important;white-space:nowrap;width:100%;overflow:hidden">%E5%8F%82%E8%80%83%EF%BC%9Ahttps%3A%2F%2Fwww.cnblogs.com%2Fcrazylqy%2Fp%2F7611069.html%0A%0A%23%23%201%202PL%EF%BC%9ATwo-Phase%20Locking%0A%0A%E4%BC%A0%E7%BB%9FRDBMS%E5%8A%A0%E9%94%81%E7%9A%84%E4%B8%80%E4%B8%AA%E5%8E%9F%E5%88%99%EF%BC%8C%E5%B0%B1%E6%98%AF2PL%20(%E4%BA%8C%E9%98%B6%E6%AE%B5%E9%94%81)%EF%BC%9ATwo-Phase%20Locking%E3%80%82%E7%9B%B8%E5%AF%B9%E8%80%8C%E8%A8%80%EF%BC%8C2PL%E6%AF%94%E8%BE%83%E5%AE%B9%E6%98%93%E7%90%86%E8%A7%A3%EF%BC%8C%E8%AF%B4%E7%9A%84%E6%98%AF%E9%94%81%E6%93%8D%E4%BD%9C%E5%88%86%E4%B8%BA%E4%B8%A4%E4%B8%AA%E9%98%B6%E6%AE%B5%EF%BC%9A%E5%8A%A0%E9%94%81%E9%98%B6%E6%AE%B5%E4%B8%8E%E8%A7%A3%E9%94%81%E9%98%B6%E6%AE%B5%EF%BC%8C%E5%B9%B6%E4%B8%94%E4%BF%9D%E8%AF%81%E5%8A%A0%E9%94%81%E9%98%B6%E6%AE%B5%E4%B8%8E%E8%A7%A3%E9%94%81%E9%98%B6%E6%AE%B5%E4%B8%8D%E7%9B%B8%E4%BA%A4%E3%80%82%E4%B8%8B%E9%9D%A2%EF%BC%8C%E4%BB%8D%E6%97%A7%E4%BB%A5MySQL%E4%B8%BA%E4%BE%8B%EF%BC%8C%E6%9D%A5%E7%AE%80%E5%8D%95%E7%9C%8B%E7%9C%8B2PL%E5%9C%A8MySQL%E4%B8%AD%E7%9A%84%E5%AE%9E%E7%8E%B0%E3%80%82%0A!%5Bc9b315caf1324fbc08ecc2c22e1193a7.png%5D(en-resource%3A%2F%2Fdatabase%2F1203%3A1)%0A%0A%0A%23%23%202%20MySQL%20InnoDB%E5%AD%98%E5%82%A8%E5%BC%95%E6%93%8E%E4%B8%AD%E4%BA%8B%E5%8A%A1%E9%9A%94%E7%A6%BB%E7%BA%A7%E5%88%AB%E4%B8%8E%E9%94%81%E7%B2%92%E5%BA%A6%0A%0A%0A%23%23%23%202-1%20%E5%BD%93%E5%89%8D%E8%AF%BB%E4%B8%8E%E5%BF%AB%E7%85%A7%E8%AF%BB%0A%0A**RDBMS%E5%8D%B3%E5%85%B3%E7%B3%BB%E6%95%B0%E6%8D%AE%E5%BA%93%E7%AE%A1%E7%90%86%E7%B3%BB%E7%BB%9F(Relational%20Database%20Management%20System)%EF%BC%8C%E6%98%AF%E5%B0%86%E6%95%B0%E6%8D%AE%E7%BB%84%E7%BB%87%E4%B8%BA%E7%9B%B8%E5%85%B3%E7%9A%84%E8%A1%8C%E5%92%8C%E5%88%97%E7%9A%84%E7%B3%BB%E7%BB%9F%E3%80%82**%0A%0AMySQL%20InnoDB%E5%AD%98%E5%82%A8%E5%BC%95%E6%93%8E%EF%BC%8C%E5%AE%9E%E7%8E%B0%E7%9A%84%E6%98%AF**%E5%9F%BA%E4%BA%8E%E5%A4%9A%E7%89%88%E6%9C%AC%E5%B9%B6%E5%8F%91%E6%8E%A7%E5%88%B6%E5%8D%8F%E8%AE%AEMVCC%EF%BC%8CMulti-Version%20Concurrency%20Control**%E3%80%82%0A%E4%B8%8EMVCC%E7%9B%B8%E5%AF%B9%E7%9A%84%EF%BC%8C%E6%98%AF**%E5%9F%BA%E4%BA%8E%E9%94%81%E7%9A%84%E5%B9%B6%E5%8F%91%E6%8E%A7%E5%88%B6%EF%BC%8CLock-Based%20Concurrency%20Control**%E3%80%82%0A%0AMVCC%E6%9C%80%E5%A4%A7%E7%9A%84%E5%A5%BD%E5%A4%84%E5%B0%B1%E6%98%AF**%E8%AF%BB%E4%B8%8D%E5%8A%A0%E9%94%81%EF%BC%8C%E8%AF%BB%E5%86%99%E4%B8%8D%E5%86%B2%E7%AA%81**%EF%BC%88Serializable%E9%9A%94%E7%A6%BB%E7%BA%A7%E5%88%AB%E9%99%A4%E5%A4%96%EF%BC%89%E3%80%82%E5%9C%A8MVCC%E5%B9%B6%E5%8F%91%E6%8E%A7%E5%88%B6%E4%B8%AD%EF%BC%8C%E8%AF%BB%E6%93%8D%E4%BD%9C%E5%8F%AF%E4%BB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%E4%BA%9B%E8%AF%BB%E6%93%8D%E4%BD%9C%E6%98%AF%E5%BF%AB%E7%85%A7%E8%AF%BB%EF%BC%9F%E5%93%AA%E4%BA%9B%E6%93%8D%E4%BD%9C%E5%8F%88%E6%98%AF%E5%BD%93%E5%89%8D%E8%AF%BB%E5%91%A2%EF%BC%9F%E4%BB%A5MySQL%20InnoDB%E4%B8%BA%E4%BE%8B%EF%BC%9A%0A%0A*%20**%E5%BF%AB%E7%85%A7%E8%AF%BB**%EF%BC%9A%E7%AE%80%E5%8D%95%E7%9A%84select%E6%93%8D%E4%BD%9C%EF%BC%8C%E5%B1%9E%E4%BA%8E%E5%BF%AB%E7%85%A7%E5%BA%A6%EF%BC%8C%E4%B8%8D%E5%8A%A0%E9%94%81%EF%BC%88%E5%BD%93%E7%84%B6%EF%BC%8C%E6%9C%89%E4%BE%8B%E5%A4%96%EF%BC%89%EF%BC%9B%0A%E4%BE%8B%E5%A6%82%EF%BC%9A%0Aselect%20*%20from%20table%20where%20%EF%BC%9F%EF%BC%9B%0A%0A*%20**%E5%BD%93%E5%89%8D%E8%AF%BB**%EF%BC%9A%E7%89%B9%E6%AE%8A%E7%9A%84%E8%AF%BB%E6%93%8D%E4%BD%9C%EF%BC%8C%E6%8F%92%E5%85%A5%2F%E6%9B%B4%E6%96%B0%2F%E5%88%A0%E9%99%A4%E6%93%8D%E4%BD%9C%EF%BC%8C%E5%B1%9E%E4%BA%8E%E5%BD%93%E5%89%8D%E8%AF%BB%EF%BC%8C%E9%9C%80%E8%A6%81%E5%8A%A0%E9%94%81%EF%BC%9B%0A%E4%BE%8B%E5%A6%82%EF%BC%9A%0Aselect%20*%20from%20table%20where%20%3F%20lock%20in%20share%20mode%EF%BC%9B%0Aselect%20*%20from%20table%20where%20%3F%20for%20update%EF%BC%9B%0Ainsert%20into%20table%20values%EF%BC%88...%EF%BC%89%EF%BC%9B%0Aupdate%20table%20set%20%3F%20where%20%3F%EF%BC%9B%0Adelete%20from%20table%20where%20%3F%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92%E4%B8%BA%E5%BD%93%E5%89%8D%E8%AF%BB%EF%BC%9F%E5%8F%AF%E4%BB%A5%E7%9C%8B%E7%9C%8B%E4%B8%8B%E9%9D%A2%E8%BF%99%E4%B8%AA%20%E6%9B%B4%E6%96%B0%20%E6%93%8D%E4%BD%9C%EF%BC%8C%E5%9C%A8%E6%95%B0%E6%8D%AE%E5%BA%93%E4%B8%AD%E7%9A%84%E6%89%A7%E8%A1%8C%E6%B5%81%E7%A8%8B%EF%BC%9A!%5Bf4017760aec4db58debbd0740d37a992.png%5D(en-resource%3A%2F%2Fdatabase%2F1201%3A1)%0A%0A%0A%E4%BB%8E%E5%9B%BE%E4%B8%AD%EF%BC%8C%E5%8F%AF%E4%BB%A5%E7%9C%8B%E5%88%B0%EF%BC%8C%E4%B8%80%E4%B8%AAUpdate%E6%93%8D%E4%BD%9C%E7%9A%84%E5%85%B7%E4%BD%93%E6%B5%81%E7%A8%8B%E3%80%82%E5%BD%93Update%20SQL%E8%A2%AB%E5%8F%91%E7%BB%99MySQL%E5%90%8E%EF%BC%8CMySQL%20Server%E4%BC%9A%E6%A0%B9%E6%8D%AEwhere%E6%9D%A1%E4%BB%B6%EF%BC%8C%E8%AF%BB%E5%8F%96%E7%AC%AC%E4%B8%80%E6%9D%A1%E6%BB%A1%E8%B6%B3%E6%9D%A1%E4%BB%B6%E7%9A%84%E8%AE%B0%E5%BD%95%EF%BC%8C%E7%84%B6%E5%90%8EInnoDB%E5%BC%95%E6%93%8E%E4%BC%9A%E5%B0%86%E7%AC%AC%E4%B8%80%E6%9D%A1%E8%AE%B0%E5%BD%95%E8%BF%94%E5%9B%9E%EF%BC%8C%E5%B9%B6%E5%8A%A0%E9%94%81%20(current%20read)%E3%80%82%E5%BE%85MySQL%20Server%E6%94%B6%E5%88%B0%E8%BF%99%E6%9D%A1%E5%8A%A0%E9%94%81%E7%9A%84%E8%AE%B0%E5%BD%95%E4%B9%8B%E5%90%8E%EF%BC%8C%E4%BC%9A%E5%86%8D%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%98%AF%E4%BD%BF%E7%94%A8%E8%8C%83%E5%9B%B4%E6%9C%80%E5%B9%BF%E7%9A%84%E3%80%82%E5%AE%83%E9%BB%98%E8%AE%A4%E7%9A%84%E4%BA%8B%E5%8A%A1%E9%9A%94%E7%A6%BB%E7%BA%A7%E5%88%AB%E6%98%AFREPEATABLE%C2%A0READ(%E5%8F%AF%E9%87%8D%E5%A4%8D%E8%AF%BB%EF%BC%89%EF%BC%8C%E5%9C%A8%E6%A0%87%E5%87%86%E7%9A%84%E4%BA%8B%E5%8A%A1%E9%9A%94%E7%A6%BB%E7%BA%A7%E5%88%AB%E5%AE%9A%E4%B9%89%E4%B8%8B%EF%BC%8CREPEATABLE%C2%A0READ%E6%98%AF%E4%B8%8D%E8%83%BD%E9%98%B2%E6%AD%A2%E5%B9%BB%E8%AF%BB%E4%BA%A7%E7%94%9F%E7%9A%84%E3%80%82INNODB%E4%BD%BF%E7%94%A8%E4%BA%86next-key%20locks%E5%AE%9E%E7%8E%B0%E4%BA%86%E9%98%B2%E6%AD%A2%E5%B9%BB%E8%AF%BB%E7%9A%84%E5%8F%91%E7%94%9F%E3%80%82**%0A%0A%0A%23%23%203%20%E5%8A%A0%E9%94%81%E8%BF%87%E7%A8%8B%E5%88%86%E6%9E%90%0A%0A%23%23%23%203-1%20%E5%89%8D%E6%8F%90%E5%88%86%E6%9E%90%0A%0A%E5%88%86%E6%9E%90%E4%B8%80%E6%9D%A1SQL%E7%9A%84%E5%8A%A0%E9%94%81%E8%BF%87%E7%A8%8B%EF%BC%8C%E9%A6%96%E5%85%88%E9%9C%80%E8%A6%81%E6%98%8E%E7%A1%AE%E5%89%8D%E6%8F%90%E7%9A%84%E6%9D%A1%E4%BB%B6%EF%BC%9A%0A%0A*%20%E6%95%B0%E6%8D%AE%E5%BA%93%E5%BD%93%E5%89%8D%E7%9A%84%E9%9A%94%E7%A6%BB%E7%BA%A7%E5%88%AB%0A*%20%E7%9B%B8%E5%85%B3%E6%9D%A1%E4%BB%B6%E5%88%97%E7%9A%84%E7%B4%A2%E5%BC%95%E6%83%85%E5%86%B5%EF%BC%9A%E4%B8%BB%E9%94%AE%E3%80%81%E5%94%AF%E4%B8%80%E7%B4%A2%E5%BC%95%E3%80%81%E6%99%AE%E9%80%9A%E4%BA%8C%E7%BA%A7%E7%B4%A2%E5%BC%95%E3%80%81%E6%B2%A1%E6%9C%89%E7%B4%A2%E5%BC%95%0A%0A**%E5%9C%A8RC%E3%80%81RR%E9%9A%94%E7%A6%BB%E7%BA%A7%E5%88%AB%E4%B8%8B%EF%BC%8C%E5%BF%AB%E7%85%A7%E8%AF%BB%EF%BC%88%E6%99%AE%E9%80%9Aselect%EF%BC%89%E6%93%8D%E4%BD%9C%E5%9D%87%E4%B8%8D%E5%8A%A0%E9%94%81%EF%BC%8C%E8%80%8C%E6%98%AF%E4%BD%BF%E7%94%A8MVCC%E6%8F%90%E4%BE%9B%E7%9A%84%E7%89%88%E6%9C%AC%E9%93%BE%E5%92%8CReadView%E7%9A%84%E6%96%B9%E5%BC%8F%E3%80%82**%0A%0A%E4%B8%8B%E9%9D%A2%E4%B8%BB%E8%A6%81%E5%88%86%E6%9E%90**%E5%BD%93%E5%89%8D%E8%AF%BB**%E6%93%8D%E4%BD%9C%E7%9A%84%E5%8A%A0%E9%94%81%E6%83%85%E5%86%B5%E3%80%81%E5%BD%93%E5%89%8D%E8%AF%BB%E5%8C%85%E5%90%AB%E7%9A%84%E5%87%A0%E7%A7%8D%E5%BD%A2%E5%BC%8F%E4%B8%8A%E9%9D%A2%E5%B7%B2%E7%BB%8F%E8%AF%B4%E8%BF%87%E3%80%82%0A%0A%23%23%23%203-2%20%E7%AE%80%E5%8D%95%E8%AF%AD%E5%8F%A5%E5%88%86%E6%9E%90%0A%E4%BB%A5**update%20test%20set%20name%20%3D%20'Tom'%20where%20id%20%3D%2010**%E8%AF%AD%E5%8F%A5%E4%B8%BA%E4%BE%8B%EF%BC%9A%0A%0A%23%23%23%23%20Read%20Committed%E9%9A%94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E4%BC%9A%E8%A2%AB%E5%8A%A0%E4%B8%8AX%E9%94%81%E3%80%82%E4%BD%86%E6%98%AF%EF%BC%8C%E4%B8%BA%E4%BA%86%E6%95%88%E7%8E%87%E8%80%83%E9%87%8F%EF%BC%8CMySQL%E5%81%9A%E4%BA%86%E4%BC%98%E5%8C%96%EF%BC%8C%E5%AF%B9%E4%BA%8E%E4%B8%8D%E6%BB%A1%E8%B6%B3%E6%9D%A1%E4%BB%B6%E7%9A%84%E8%AE%B0%E5%BD%95%EF%BC%8C%E4%BC%9A%E5%9C%A8%E5%88%A4%E6%96%AD%E5%90%8E%E6%94%BE%E9%94%81%EF%BC%8C%E6%9C%80%E7%BB%88%E6%8C%81%E6%9C%89%E7%9A%84%EF%BC%8C%E6%98%AF%E6%BB%A1%E8%B6%B3%E6%9D%A1%E4%BB%B6%E7%9A%84%E8%AE%B0%E5%BD%95%E4%B8%8A%E7%9A%84%E9%94%81%EF%BC%8C%E4%BD%86%E6%98%AF%E4%B8%8D%E6%BB%A1%E8%B6%B3%E6%9D%A1%E4%BB%B6%E7%9A%84%E8%AE%B0%E5%BD%95%E4%B8%8A%E7%9A%84%E5%8A%A0%E9%94%81%2F%E6%94%BE%E9%94%81%E5%8A%A8%E4%BD%9C%E4%B8%8D%E4%BC%9A%E7%9C%81%E7%95%A5%E3%80%82%E5%90%8C%E6%97%B6%EF%BC%8C%E4%BC%98%E5%8C%96%E4%B9%9F%E8%BF%9D%E8%83%8C%E4%BA%862PL%E7%9A%84%E7%BA%A6%E6%9D%9F%E3%80%82%0A%0A%23%23%23%23%20Reapeatable%20Read%E9%9A%94%E7%A6%BB%E7%BA%A7%E5%88%AB%0A%0A%E5%9C%A8%E8%AF%A5%E9%9A%94%E7%A6%BB%E7%BA%A7%E5%88%AB%E4%B8%8B%EF%BC%8CInnoDB%E6%8F%90%E4%BE%9B**Next-Key%20Locks%EF%BC%8C%E5%8D%B3Record%20Locks%20%2B%20Gap%20Locks**%E3%80%82%0A%0A*%20id%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%5B4fbc09c0012466040328d1cb11b3c7e4.png%5D(en-resource%3A%2F%2Fdatabase%2F1205%3A1)%0A%0A*%20id%E6%97%A0%E7%B4%A2%E5%BC%95%EF%BC%8C%E5%9C%A8Repeatable%20Read%E9%9A%94%E7%A6%BB%E7%BA%A7%E5%88%AB%E4%B8%8B%EF%BC%8C%E5%A6%82%E6%9E%9C%E8%BF%9B%E8%A1%8C%E5%85%A8%E8%A1%A8%E6%89%AB%E6%8F%8F%E7%9A%84%E5%BD%93%E5%89%8D%E8%AF%BB%EF%BC%8C%E9%82%A3%E4%B9%88%E4%BC%9A%E9%94%81%E4%B8%8A%E8%A1%A8%E4%B8%AD%E7%9A%84%E6%89%80%E6%9C%89%E8%AE%B0%E5%BD%95%EF%BC%8C%E5%90%8C%E6%97%B6%E4%BC%9A%E9%94%81%E4%B8%8A%E8%81%9A%E7%B0%87%E7%B4%A2%E5%BC%95%E5%86%85%E7%9A%84%E6%89%80%E6%9C%89GAP%EF%BC%8C%E6%9D%9C%E7%BB%9D%E6%89%80%E6%9C%89%E7%9A%84%E5%B9%B6%E5%8F%91%20%E6%9B%B4%E6%96%B0%2F%E5%88%A0%E9%99%A4%2F%E6%8F%92%E5%85%A5%20%E6%93%8D%E4%BD%9C%E3%80%82%0A%0A%0A%0A%23%23%23%203-3%20%E5%A4%8D%E6%9D%82%E8%AF%AD%E5%8F%A5%E5%88%86%E6%9E%90%0A%0A!%5B31977f9857b767c195d697830d711479.png%5D(en-resource%3A%2F%2Fdatabase%2F1207%3A1)%0A%0A%E5%A6%82%E5%9B%BE%E4%B8%AD%E7%9A%84SQL%EF%BC%8C%E4%BC%9A%E5%8A%A0%E4%BB%80%E4%B9%88%E9%94%81%EF%BC%9F%E5%81%87%E5%AE%9A%E5%9C%A8Repeatable%20Read%E9%9A%94%E7%A6%BB%E7%BA%A7%E5%88%AB%E4%B8%8B%20(Read%20Committed%E9%9A%94%E7%A6%BB%E7%BA%A7%E5%88%AB%E4%B8%8B%E7%9A%84%E5%8A%A0%E9%94%81%E6%83%85%E5%86%B5%EF%BC%8C%E7%95%99%E7%BB%99%E8%AF%BB%E8%80%85%E5%88%86%E6%9E%90%E3%80%82)%EF%BC%8C%E5%90%8C%E6%97%B6%EF%BC%8C%E5%81%87%E8%AE%BESQL%E8%B5%B0%E7%9A%84%E6%98%AFidx_t1_pu%E7%B4%A2%E5%BC%95%E3%80%82%0A!%5Bf8a8975dd2955f2d31e232fd10d65698.png%5D(en-resource%3A%2F%2Fdatabase%2F1208%3A1)%0A%0A%E5%9C%A8%E5%88%86%E6%9E%90%E5%87%BASQL%20where%E6%9D%A1%E4%BB%B6%E7%9A%84%E6%9E%84%E6%88%90%E4%B9%8B%E5%90%8E%EF%BC%8C%E5%86%8D%E6%9D%A5%E7%9C%8B%E7%9C%8B%E8%BF%99%E6%9D%A1SQL%E7%9A%84%E5%8A%A0%E9%94%81%E6%83%85%E5%86%B5%20(RR%E9%9A%94%E7%A6%BB%E7%BA%A7%E5%88%AB)%EF%BC%8C%E5%A6%82%E4%B8%8B%E5%9B%BE%E6%89%80%E7%A4%BA%EF%BC%9A%0A!%5B738cefc9890337856603dcf1f54b720f.png%5D(en-resource%3A%2F%2Fdatabase%2F1210%3A1)%0A%0A%0A%E4%BB%8E%E5%9B%BE%E4%B8%AD%E5%8F%AF%E4%BB%A5%E7%9C%8B%E5%87%BA%EF%BC%8C%E5%9C%A8Repeatable%20Read%E9%9A%94%E7%A6%BB%E7%BA%A7%E5%88%AB%E4%B8%8B%EF%BC%8C%E7%94%B1Index%20Key%E6%89%80%E7%A1%AE%E5%AE%9A%E7%9A%84%E8%8C%83%E5%9B%B4%EF%BC%8C%E8%A2%AB%E5%8A%A0%E4%B8%8A%E4%BA%86GAP%E9%94%81%EF%BC%9BIndex%20Filter%E9%94%81%E7%BB%99%E5%AE%9A%E7%9A%84%E6%9D%A1%E4%BB%B6%20(userid%20%3D%20%E2%80%98hdc%E2%80%99)%E4%BD%95%E6%97%B6%E8%BF%87%E6%BB%A4%EF%BC%8C%E8%A7%86MySQL%E7%9A%84%E7%89%88%E6%9C%AC%E8%80%8C%E5%AE%9A%EF%BC%8C%E5%9C%A8MySQL%205.6%E7%89%88%E6%9C%AC%E4%B9%8B%E5%89%8D%EF%BC%8C%E4%B8%8D%E6%94%AF%E6%8C%81Index%20Condition%20Pushdown(ICP)%EF%BC%8C%E5%9B%A0%E6%AD%A4Index%20Filter%E5%9C%A8MySQL%20Server%E5%B1%82%E8%BF%87%E6%BB%A4%EF%BC%8C%E5%9C%A85.6%E5%90%8E%E6%94%AF%E6%8C%81%E4%BA%86Index%20Condition%20Pushdown%EF%BC%8C%E5%88%99%E5%9C%A8index%E4%B8%8A%E8%BF%87%E6%BB%A4%E3%80%82%E8%8B%A5%E4%B8%8D%E6%94%AF%E6%8C%81ICP%EF%BC%8C%E4%B8%8D%E6%BB%A1%E8%B6%B3Index%20Filter%E7%9A%84%E8%AE%B0%E5%BD%95%EF%BC%8C%E4%B9%9F%E9%9C%80%E8%A6%81%E5%8A%A0%E4%B8%8A%E8%AE%B0%E5%BD%95X%E9%94%81%EF%BC%8C%E8%8B%A5%E6%94%AF%E6%8C%81ICP%EF%BC%8C%E5%88%99%E4%B8%8D%E6%BB%A1%E8%B6%B3Index%20Filter%E7%9A%84%E8%AE%B0%E5%BD%95%EF%BC%8C%E6%97%A0%E9%9C%80%E5%8A%A0%E8%AE%B0%E5%BD%95X%E9%94%81%20(%E5%9B%BE%E4%B8%AD%EF%BC%8C%E7%94%A8%E7%BA%A2%E8%89%B2%E7%AE%AD%E5%A4%B4%E6%A0%87%E5%87%BA%E7%9A%84X%E9%94%81%EF%BC%8C%E6%98%AF%E5%90%A6%E8%A6%81%E5%8A%A0%EF%BC%8C%E8%A7%86%E6%98%AF%E5%90%A6%E6%94%AF%E6%8C%81ICP%E8%80%8C%E5%AE%9A)%EF%BC%9B%E8%80%8CTable%20Filter%E5%AF%B9%E5%BA%94%E7%9A%84%E8%BF%87%E6%BB%A4%E6%9D%A1%E4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%E6%9D%A1%E4%BB%B6%EF%BC%8C%E8%A7%86MySQL%E7%89%88%E6%9C%AC%E6%98%AF%E5%90%A6%E6%94%AF%E6%8C%81ICP%EF%BC%8C%E8%8B%A5%E6%94%AF%E6%8C%81ICP%EF%BC%8C%E5%88%99%E4%B8%8D%E6%BB%A1%E8%B6%B3Index%20Filter%E7%9A%84%E8%AE%B0%E5%BD%95%EF%BC%8C%E4%B8%8D%E5%8A%A0X%E9%94%81%EF%BC%8C%E5%90%A6%E5%88%99%E9%9C%80%E8%A6%81X%E9%94%81%EF%BC%9BTable%20Filter%E8%BF%87%E6%BB%A4%E6%9D%A1%E4%BB%B6%EF%BC%8C%E6%97%A0%E8%AE%BA%E6%98%AF%E5%90%A6%E6%BB%A1%E8%B6%B3%EF%BC%8C%E9%83%BD%E9%9C%80%E8%A6%81%E5%8A%A0X%E9%94%81%E3%80%82**%0A%0A%23%23%204%20%E6%AD%BB%E9%94%81%E5%8E%9F%E7%90%86%E4%B8%8E%E5%88%86%E6%9E%90%0A%0A%0A%E6%9C%AC%E6%96%87%E5%89%8D%E9%9D%A2%E7%9A%84%E9%83%A8%E5%88%86%EF%BC%8C%E5%9F%BA%E6%9C%AC%E4%B8%8A%E5%B7%B2%E7%BB%8F%E6%B6%B5%E7%9B%96%E4%BA%86MySQL%2FInnoDB%E6%89%80%E6%9C%89%E7%9A%84%E5%8A%A0%E9%94%81%E8%A7%84%E5%88%99%E3%80%82%E6%B7%B1%E5%85%A5%E7%90%86%E8%A7%A3MySQL%E5%A6%82%E4%BD%95%E5%8A%A0%E9%94%81%EF%BC%8C%E6%9C%89%E4%B8%A4%E4%B8%AA%E6%AF%94%E8%BE%83%E9%87%8D%E8%A6%81%E7%9A%84%E4%BD%9C%E7%94%A8%EF%BC%9A%0A%0A*%20%E5%8F%AF%E4%BB%A5%E6%A0%B9%E6%8D%AEMySQL%E7%9A%84%E5%8A%A0%E9%94%81%E8%A7%84%E5%88%99%EF%BC%8C%E5%86%99%E5%87%BA%E4%B8%8D%E4%BC%9A%E5%8F%91%E7%94%9F%E6%AD%BB%E9%94%81%E7%9A%84SQL%EF%BC%9B%0A*%20%E5%8F%AF%E4%BB%A5%E6%A0%B9%E6%8D%AEMySQL%E7%9A%84%E5%8A%A0%E9%94%81%E8%A7%84%E5%88%99%EF%BC%8C%E5%AE%9A%E4%BD%8D%E5%87%BA%E7%BA%BF%E4%B8%8A%E4%BA%A7%E7%94%9F%E6%AD%BB%E9%94%81%E7%9A%84%E5%8E%9F%E5%9B%A0%EF%BC%9B%0A%0A%0A%E4%B8%8B%E9%9D%A2%EF%BC%8C%E6%9D%A5%E7%9C%8B%E7%9C%8B%E4%B8%A4%E4%B8%AA%E6%AD%BB%E9%94%81%E7%9A%84%E4%BE%8B%E5%AD%90%20(%E4%B8%80%E4%B8%AA%E6%98%AF%E4%B8%A4%E4%B8%AASession%E7%9A%84%E4%B8%A4%E6%9D%A1SQL%E4%BA%A7%E7%94%9F%E6%AD%BB%E9%94%81%EF%BC%9B%E5%8F%A6%E4%B8%80%E4%B8%AA%E6%98%AF%E4%B8%A4%E4%B8%AASession%E7%9A%84%E4%B8%80%E6%9D%A1SQL%EF%BC%8C%E4%BA%A7%E7%94%9F%E6%AD%BB%E9%94%81)%EF%BC%9A!%5B8d36652e19b694fc72c90a413d0adae5.png%5D(en-resource%3A%2F%2Fdatabase%2F1211%3A1)%0A!%5Bcb182aaa64db7493675adbea7e6ce20e.png%5D(en-resource%3A%2F%2Fdatabase%2F1212%3A1)%0A%0A%E4%B8%8A%E9%9D%A2%E7%9A%84%E4%B8%A4%E4%B8%AA%E6%AD%BB%E9%94%81%E7%94%A8%E4%BE%8B%E3%80%82%E7%AC%AC%E4%B8%80%E4%B8%AA%E9%9D%9E%E5%B8%B8%E5%A5%BD%E7%90%86%E8%A7%A3%EF%BC%8C%E4%B9%9F%E6%98%AF%E6%9C%80%E5%B8%B8%E8%A7%81%E7%9A%84%E6%AD%BB%E9%94%81%EF%BC%8C%E6%AF%8F%E4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7%9A%84%E6%AD%BB%E9%94%81%E6%83%85%E5%86%B5%EF%BC%8C%E4%B9%9F%E5%8F%AF%E4%BB%A5%E5%88%86%E6%9E%90%E5%87%BA%E7%BA%BF%E4%B8%8A%E6%AD%BB%E9%94%81%E5%8F%91%E7%94%9F%E7%9A%84%E5%8E%9F%E5%9B%A0%E3%80%82**</center></span>
</div></body></html> 